<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function findLengthOfLIS(nums) {
        const arr = new Array(nums.length).fill(1)
        let maxLength = 1
        for (let i = 1; i < nums.length; i++) {
          for (let j = 0; j < i; j++) {
            if (nums[i] > nums[j]) {
              arr[i] = Math.max(arr[i], arr[j] + 1)
            }
          }
          maxLength = Math.max(maxLength, arr[i])
        }
        return maxLength
      }
      // findLengthOfLIS([1, 5, 3, 7, 6, 4, 9, 8, 11])
      console.log(findLengthOfLIS([1, 3, 6, 4, 7, 11, 9]))
    </script>
  </body>
</html>
